package Casino;

/***************************
Nathan Mulder
Matthew K
Mathew Baugh
Group Project
Casino
**************************/

import java.util.Scanner;

public class Donate
{
	Wallet wallet = new Wallet();
	Scanner input = new Scanner(System.in);
	private static double donation;
	
	public void donateMoney()
	{
		System.out.print("\nSo you want to donate some money to charity? \nWho knows? Maybe you'll increase your luck by donating to a good cause. \nHow much do you plan to donate?: $");
		double donat = input.nextDouble();
		
		if ((donat > 0))
		{
			if (donat <= wallet.getMoney())
			{
				donation = donat + donation;
				wallet.setMoney((donat * (-1)));
				System.out.printf("You just donated $%.2f.\nYou have $%.2f remaining in your wallet.\nHopefully luck will now be on your side!", donat, wallet.getMoney());
			}
			else
				System.out.println("You can't donate more than you have in your wallet!");
		}
		else
			System.out.println("\nYou can't donate a negative amount!");
	}
	
	public double increaseOdds(double moneyEarned)
	{
		if (moneyEarned > 0)
		{
			double improvedScore = donation * .05;
			double payoff = moneyEarned * (1 + improvedScore);
			
			if (donation > 0)			
				System.out.printf("\nDue to your increased luck, you won $%.2f from this game!", payoff);
			
			donation = 0;
			return payoff;
			
		}
		else
		{
			return moneyEarned;
		}
	}
}
